/**
 * Created by joyi on 2017/2/16.
 */
public class Stars {
    /**
     * 此处用于输出星星
     * @param args
     */
    public static void main(String[] args) {
//        System.out.println(3/2);
        getView(5);
    }
    /**
     * 动态打印星星图案到页面
     * @param lines 设定星星中间行
     */
    public static void getView(int lines){
        for (int i = 0; i <lines ; i++) {
            for (int j = 0; j <lines-i ; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j <i+1 ; j++) {
                System.out.print(" *");
            }
            System.out.println();
        }
        for (int i = 0; i <lines-1 ; i++) {
            for (int j = 0; j <=i+1; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j <lines-i-1 ; j++) {
                System.out.print(" *");
            }
            System.out.println();
        }
    }
}
